package com.sgb.kjwl.view.ui.adapter.self;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.sgb.kjwl.R;
import com.sgb.kjwl.model.entity.Bean;

import java.util.List;


/**
 * 作者:张磊
 * 日期:2021/1/21 0021
 * 说明:
 */
public class TypeAdapter extends BaseQuickAdapter<Bean, BaseViewHolder> {
    public TypeAdapter(List<Bean> data) {
        super(R.layout.adapter_type, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, Bean item) {
        helper
                .setText(R.id.tv_name, item.name)
                .setImageResource(R.id.iv_icon, item.type == 0 ? R.mipmap.withdraw_icon
                        : item.type == 1 ? R.mipmap.water_icon : item.type == 2 ? R.mipmap.card_icon : R.mipmap.authentication_icon)
        ;
    }
}